<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        

        class Person{
           constructor(){
               this.name = '人类';
               this.age = 1;
           }
           say(){
               console.log(this,`${this.name}的年龄是${this.age}`);
           }
        }

        // extends 继承 - 相当于实现了组合继承
        class Student extends Person{
           
        }

        const p1 = new Person();
        p1.say();

        const stu1 = new Student();
        stu1.say();
       
        


    </script>
</body>

</html>